Skip to content

Instantly share code, notes, and snippets.

@alimogh
alimogh / colors.py
Created May 9, 2024 10:20 — forked from rene-d/colors.py
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
@rene-d
rene-d / colors.py
Last active May 9, 2024 10:20
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
@SebaUbuntu
SebaUbuntu / README.md
Last active May 9, 2024 10:17
Generate framework compatibility matrix from fqnames

Generate framework compatibility matrix from fqnames

  • Download these 2 files
  • Compile AOSP without fcm from stock and wait for check_vintf to error out
  • Delete Python prefix from all lines (e.g. checkvintf E 06-24 00:30:22 49120 49120 check_vintf.cpp:554])
  • Paste the result in fqnames.txt
  • Launch the script
@enesien
enesien / shadcn-multi-tag-input.md
Last active May 9, 2024 10:15
shadcn multiple tag input

shadcn/ui multi tag input component

A react tag input field component using shadcn, like one you see when adding keywords to a video on YouTube. Usable with Form or standalone.

Preview

image

Standalone Usage

@nicolasdao
nicolasdao / open_source_licenses.md
Last active May 9, 2024 10:14
What you need to know to choose an open source license.
@scruel
scruel / fix-ms-input-pinyin-phrase.py
Last active May 9, 2024 10:14
修正微软拼音输入法无法添加多个格式化自定义短语的问题,默认添加 sj 和 rq 两个自定义短语
"""
修正微软拼音输入法无法添加多个格式化自定义短语的问题
Author: Scruel Tao
"""
import os
import re
import pathlib
import traceback
from pathlib import Path
@chessmango
chessmango / README.md
Last active May 9, 2024 10:13
Simple Bash add-apt-repository drop-in

Things are awkward in the apt world while apt-key is deprecated and things like Launchpad and general PPA usage are in flux.

This snippet attempts to replicate add-apt-repository functionality for sanity, probably quite badly. There's no error checking or anything advanced, but at least the script is easy to understand.

Syntax: [sudo] addaptrepo.sh <repo-string> <gpg-key-fingerprint>

Then follow up with [sudo] apt-get update. I'm not making that call for you :P

You can find the gpg key fingerprint for a Launchpad repo by expanding Technical details about this PPA.

Async and Await: Here be dragons

Overview

  • Background
  • Basics
  • Concepts
  • Examples

In the Beginning …